<template>
  <div class="collect-mask flex-center flex-align-items-center">
    <div class="main">
      <div class="main-title flex-between flex-align-items-center">
        <p class="font-14-B">选择收藏夹</p>
        <i class="iconfont icon-guanbi pointer" @click="close"></i>
      </div>
      <div v-if="list.length === 0" class="no-data flex flex-column flex-align-items-center">
        <p class="font-12">当前暂无收藏夹</p>
        <div class="pointer flex-center flex-align-items-center">
          <span class="font-16">创建收藏夹</span>
          <i class="iconfont icon-youjiantou1"></i>
        </div>
      </div>
      <div v-if="list.length > 0" class="list">
        <div v-for="item in list" :key="item.id" class="item flex-between flex-align-items-center">
          <p class="item-name font-14">{{ item.name }}</p>
          <p class="item-btn font-14 pointer">收藏</p>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref, defineEmits } from 'vue';

const emit = defineEmits(['close']);

const list = ref([]);

const close = () => {
  emit('close');
}
</script>

<style lang="less" scoped>
.collect-mask {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 999;
  width: 100%;
  height: 100%;

  &::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: #000;
    opacity: 0.4;
  }

  .main {
    position: relative;
    z-index: 10;
    width: 480px;
    background: #fff;
    box-shadow: 0 2px 8px 0 rgba(0, 0, 0, .1);
    border-radius: 10px;
    padding-bottom: 30px;

    .main-title {
      padding: 16px 24px 10px;

      p {
        color: #333;
      }
    }

    .no-data {
      padding-top: 34px;

      p {
        color: #999;
        margin-bottom: 16px;
      }

      div {
        width: 136px;
        height: 44px;
        background: linear-gradient(140deg, #a775ff, #ff5277);
        border-radius: 10px;

        span {
          color: #fff;
          margin-right: 8px;
        }
        
        i {
          color: #fff;
        }
      }
    }

    .list {
      padding: 0 24px;
      max-height: 400px;
      overflow-y: auto;

      .item {
        border-bottom: 1px solid #ededed;
        padding-top: 22px;
        padding-bottom: 16px;

        .item-name {
          color: #606266;
        }

        .item-btn {
          width: 64px;
          height: 32px;
          background: rgba(255, 82, 119, .1);
          border-radius: 6px;
          color: #ff5277;
          text-align: center;
          line-height: 32px;
        }
      }
    }
  }
}
</style>
